package cn.javabb.service;

import cn.javabb.common.entity.Student;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;
import java.util.Map;

/**
 * @desc:
 * @author: javabb (javabob(a)163.com)
 * @create: 2020/08/02 16:43
 */
@FeignClient(value = "STUDENT-PROVIDER-SERVER",fallbackFactory=StudentClientFallbackFactory.class)
public interface StudentClientService {
    /**
     * 根据id查询学生信息
     * @param id
     * @return
     */
    @GetMapping(value="/student/query/{id}")
    public Student query(@PathVariable("id") Integer id);

    /**
     * 查询学生信息
     * @return
     */
    @GetMapping(value="/student/all")
    public List<Student> all();

    /**
     * 添加或者修改学生信息
     * @param student
     * @return
     */
    @PostMapping(value="/student/save")
    public boolean save(Student student);

    /**
     * 根据id删除学生信息
     * @return
     */
    @GetMapping(value="/student/delete/{id}")
    public boolean delete(@PathVariable("id") Integer id);

    /**
     * 获取信息
     * @return
     */
    @GetMapping(value = "/student/getInfo")
    public Map<String, Object> getInfo();

}
